package com.scedu.domain;

import com.scedu.enums.OrderStatusEnums;
import com.scedu.enums.PayStatusEnums;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/*
订单表 实体
 */
@Entity
@Data
@DynamicUpdate
@DynamicInsert
public class OrderMaster {
    @Id
    private String orderId;
    private  String orderName;
    private  String orderPhone;
    private  String orderAddress;
    private String orderOpenid;
    private BigDecimal orderAmount;
    private Integer orderStatus= OrderStatusEnums.NEW.getCode(); //订单状态,默认0 新订单
    private Integer payStatus= PayStatusEnums.NOTPAYED.getCode(); //支付状态,默认0，未支付
    private Date create_time;
    private  Date  update_time;
//    @Transient
//    private List<OrderDetail> orderDetailList;//订单详情列表
    public OrderMaster() {
    }

    public OrderMaster(String orderId, String orderName, String orderPhone, String orderAddress, String orderOpenid, BigDecimal orderAmount, Integer orderStatus, Integer payStatus) {
        this.orderId = orderId;
        this.orderName = orderName;
        this.orderPhone = orderPhone;
        this.orderAddress = orderAddress;
        this.orderOpenid = orderOpenid;
        this.orderAmount = orderAmount;
        this.orderStatus = orderStatus;
        this.payStatus = payStatus;
    }
}
